1 class (Duration: 1 hour 30 minutes; maximum 4 students per group).
Desktop or laptop computer, CPX board, USB cable
Micro Servo 9g
IR sensor
Familiarity with servo motors and controlling angles (0°–180°)
Experience connecting components using jumper wires
Using a computer and Mu Editor to upload code to the CPX
Introduction to IR Sensor:
Click here to view the instructions for the connections
Click here to view the explanation and code
Build a simple automatic door system using IR Sensor and CPX:
Click here to view the instruction video for building the door system
Click here to view the pseudocode for this exercise
Click here to see the solution video for Exercise 2
Click here to view the instructions and code for Exercise 2
How do you think the IR sensor decides whether something is in front of it, and what factors might affect how accurately it detects objects?
How does a servo motor know exactly where to stop (for example at 30°, 90°, or 180°), and what do you think the CPX is sending to help it reach that position?